# 4 - 3 - 3 偏导数
def f2(x):
    return x[0]**2 + x[1]**2

def func_temp(x0):
    return x0*x0 + 4.0**2.0

def numerical_diff(f, x):
    h = 1e-4 # 0.0001
    return (f(x+h) - f(x-h)) / (2*h)

print(numerical_diff(func_temp, 3.0))